docs: reflect group distribution lane serialization (whatsapp-rust#1043) - #407
Conversation
Document the group-distribution-lane guard now covering the full audit-reset-redistribute sequence (SKDM fan-out, rotation, status sends, phash recovery, periodic rotation), the DB-first tracker reset with cold-mark fallback, and the new memory_report() eviction counters. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HQHZ4ZVUE3SqHAY6bbLzdG
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
|
Caution Review failedAn error occurred during the review process. Please try again later. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
| Filename | Overview |
|---|---|
| advanced/signal-protocol.mdx | Three new Notes added under the sender-keys section covering lane-scope expansion, DB-first tracker resets, and observability counters; the clear_sender_key_devices reference on line 645 correctly updated to reset_sender_key_device_tracking, addressing the stale-reference concern from a prior review. All internal anchors verified correct. |
| api/bot.mdx | Updated group_distribution_locks_capacity description from single-flight cold SKDM to soft-cap semantics; added a Note cross-referencing the three new memory_report() counters. Note is correctly placed after the last row of the coordination-caches table and before #### Sent message DB cleanup. |
| api/client.mdx | Three new MemoryReport fields inserted after chat_lanes: group_distribution_locks, group_distribution_lock_evictions, group_distribution_lock_eviction_blocks. Descriptions are consistent with the counterpart Note in api/bot.mdx and the Observability Note in advanced/signal-protocol.mdx. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Group send / rotate / status / recovery] --> B[Acquire per-group distribution lane]
B --> C{Lane live?}
C -- Yes --> D[Temporarily exceed capacity soft cap\nincrement eviction_blocks counter]
C -- No / new --> E[Take lane]
D --> E
E --> F[Delete own sender key if rotating]
F --> G[reset_sender_key_device_tracking]
G --> H{DB clear success?}
H -- Yes --> I[Invalidate in-memory SenderKeyDeviceCache]
H -- No --> J[Mark all tracked rows cold\nhas_key=false]
J --> K{Cold-mark success?}
K -- No --> L[Return error — fail-closed]
K -- Yes --> I
I --> M[SKDM fan-out / redistribution]
M --> N[Release distribution lane]
N --> O[Increment evictions counter if cold lane evicted]
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
A[Group send / rotate / status / recovery] --> B[Acquire per-group distribution lane]
B --> C{Lane live?}
C -- Yes --> D[Temporarily exceed capacity soft cap\nincrement eviction_blocks counter]
C -- No / new --> E[Take lane]
D --> E
E --> F[Delete own sender key if rotating]
F --> G[reset_sender_key_device_tracking]
G --> H{DB clear success?}
H -- Yes --> I[Invalidate in-memory SenderKeyDeviceCache]
H -- No --> J[Mark all tracked rows cold\nhas_key=false]
J --> K{Cold-mark success?}
K -- No --> L[Return error — fail-closed]
K -- Yes --> I
I --> M[SKDM fan-out / redistribution]
M --> N[Release distribution lane]
N --> O[Increment evictions counter if cold lane evicted]
Reviews (2): Last reviewed commit: "docs: fix stale clear_sender_key_devices..." | Re-trigger Greptile
Address Greptile review feedback on PR #407: the rotation bullet still named the old clear_sender_key_devices call instead of reset_sender_key_device_tracking, and "also fails too" was redundant. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HQHZ4ZVUE3SqHAY6bbLzdG
Summary
Documents oxidezap/whatsapp-rust#1043 ("fix(signal): serialize sender-key mutations"):
advanced/signal-protocol.mdx— three new notes under the sender-keys section:reset_sender_key_device_trackingis DB-first: it clears tracking durably before invalidating the in-memory cache, with a cold-mark fallback if the clear fails, and the unknown-participant retry-rotation path now flushes before any later throttle in the same call can return earlymemory_report()counters for distribution-lane pressureapi/client.mdx— three newMemoryReportfields:group_distribution_locks,group_distribution_lock_evictions,group_distribution_lock_eviction_blocksapi/bot.mdx— updated thegroup_distribution_locks_capacitycache-config description to match the new soft-cap semantics (a live lane is never evicted) and cross-referenced the newmemory_report()countersPer project convention (see
CLAUDE.md), thechangelog/directory is left untouched — that's maintained by a human.🤖 Generated with Claude Code
Generated by Claude Code
Summary by cubic
Update docs: the per-group sender-key distribution lane covers the full audit → reset → redistribute sequence to prevent races in SKDM fan-out, rotations, status sends, and recovery.
Also document DB-first tracker resets with a cold-mark fallback, add
memory_report()counters (group_distribution_locks,group_distribution_lock_evictions,group_distribution_lock_eviction_blocks), clarify thegroup_distribution_locks_capacitysoft-cap semantics, and fix a staleclear_sender_key_devicesreference toreset_sender_key_device_tracking.Written for commit 5a5a85f. Summary will update on new commits.